{% extends "_layout.html" %}
{% import "component/statistics.njk" as statistics %}

{# 样式代码 #}
{% block style %}
<title>选择教材版本</title>
<style type="text/css">
    .mui-content>.mui-table-view:first-child{margin: 0;}
    .mui-table-view-cell{ padding: 16px 15px;}
    .mui-table-view-cell>a:not(.mui-btn){margin: -16px -15px;}
</style>
{% endblock %}

{# bodyd代码#}
{% block body %}
<div class="mui-content">
    <ul class="mui-table-view mui-table-view-chevron">
        {%for item in data%}
        <li class="mui-table-view-cell">
            <a onclick="js_teaching(this)" href="javascript:void(0)" class="mui-navigate-right" data-id="{{item.id}}">
                {{item.name}}
            </a>
        </li>
        {%endfor%}
    </ul>
</div>
{% endblock %}

{#js代码#}
{% block js %}
<script src="js/jquery-2.1.1.min.js"></script>
<script>
    function js_teaching(e){
        let url = location.search;
        let id = $(e).context.dataset['id'];
        let text = $(e).context.innerText;
        localStorage.setItem('teaching',text);
        localStorage.setItem('id',id);
        window.location.href = 'arrhomework2'+url;
    }
</script>
<!--flotdemo-->
{% endblock %}
